package schach.server.model;

import java.util.ArrayList;

public class Springer extends Figur {

	public Springer(Feld position, boolean alive, boolean black) {
		super(position, alive, black);
	}

	@Override
	public ArrayList<Feld> crossedFields(Feld f, boolean schlagen) throws NullPointerException {
		int deltaX = Math.abs(f.getX() - getPosition().getX());
		int deltaY = Math.abs(f.getY() - getPosition().getY());
		int delta = Math.abs(deltaX - deltaY);
		
		if (!(deltaX > 0 && deltaX < 3 && deltaY > 0 && deltaY < 3 && delta == 1)){
			throw new NullPointerException();
		}
		return null;
	}

}
